<?php

namespace common\models\tsline;

use Yii;

/**
 * This is the model class for table "{{%ts_dynamic_gallery}}".
 *
 * @property int $id
 * @property int $dynamic_id 文章ID
 * @property int $attach_id 附件ID
 * @property string $image 图片
 * @property string $caption 图片标题
 * @property int $is_thumb 是否缩略图
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 */
class TslineDynamicGallery extends \yii\db\ActiveRecord {

    use \common\traits\TimestampBehavior;

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%ts_dynamic_gallery}}';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['dynamic_id', 'attach_id', 'is_thumb', 'created_at', 'updated_at'], 'integer'],
            [['image'], 'required'],
            [['image'], 'string', 'max' => 255],
            [['caption'], 'string', 'max' => 128],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'dynamic_id' => '文章ID',
            'attach_id' => '附件ID',
            'image' => '图片',
            'caption' => '图片标题',
            'is_thumb' => '是否缩略图',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }

}
